/* 
Temperature sensor related code
*/

#include <p30F4011.h>
#include "settings.h"
#include "AC-Controller.h"
#include "globals.h"

void ProcessTemperatures() {
		// Check for thermal cutback, and figure out what max_current_ref should be.
		//else if ((counter_2k & 0x03) == 0x03) {
		//	loc_temperature2 = ADCBUF0; // AN3
		//	if (loc_temperature2 > THERMAL_CUTBACK_START) {
		//		// time to do thermal cutback
		//		u = (loc_temperature2 - THERMAL_CUTBACK_START) / 8;
		//		if (u >= 7) 
		//			u = 0;						// do not deliver any current (too hot)
		//		else {
		//			// u is now 6 to 0 (for 1/8 to 7/8 current)
		//			u = 7 - u;
		//			// u is now 1 for 1/8, 2 for 2/8, 7 for 7/8, etc.
		//			u = (u * MAX_CURRENT_REF) >> 3;
		//		}
		//	}
		//	else {
		//		// can deliver full current
		//		u = MAX_CURRENT_REF;
		//	}
 		//	max_current_ref = u;
		//}
}
